<?php
/*
	
*/
defined('BY_JYA') or exit('Access Denied');
global $_RQ,$_AR;

$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$return=array();
$basic=$this->plugin_setting('basic');
$return['banner']=$basic['image'];
$return['basic']=$basic;
//我的收藏
if($_RQ['op']=='main'){
	$shoucanglist=pdo_getall('jy_quntui_shoucang',array('uniacid'=>$_SESSION['uniacid'],'isshoucang'=>1,'mid'=>$_SESSION['uid']),'','createtime desc');
	$list=array();
	if($shoucanglist){
		foreach($shoucanglist as &$item){
			$opus=pdo_get('jy_quntui_qun',array('id'=>$item['oid'],'uniacid'=>$_SESSION['uniacid']));
			if(empty($opus)){
				pdo_delete('jy_quntui_shoucang',array('uniacid'=>$_SESSION['uniacid'],'oid'=>$item['oid']));
			}else{
				array_push($list,$opus);
			}
		}
	}
	if($list){
		$sum=count($list);
		foreach($list as &$item){
			$item['createtime']=date('Y-m-d H:i:s',$item['createtime']);
			$member=pdo_get('core_members',array('id'=>$item['mid'],'uniacid'=>$_SESSION['uniacid']),array('credit1','credit2','mobile','groupid','avatar','nickname'));
			$item['lealname']=$item['lealname']?$item['lealname']:$member['nickname'];
		}
	}
	$return['list']=$list;
	$return['sum']=$sum;
	exi($return);

}
